package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.StoreMemberCustomDiscountMapper;
import com.ruoyi.system.domain.StoreMemberCustomDiscount;
import com.ruoyi.system.service.IStoreMemberCustomDiscountService;

/**
 * 门店会员另设折扣（存储各门店的独立会员折扣配置）Service业务层处理
 *
 * @author ruoyi
 * @date 2025-05-14
 */
@Service
public class StoreMemberCustomDiscountServiceImpl implements IStoreMemberCustomDiscountService
{
    @Autowired
    private StoreMemberCustomDiscountMapper storeMemberCustomDiscountMapper;

    /**
     * 通过id查询门店会员另设折扣
     *
     * @param id 门店会员另设折扣（存储各门店的独立会员折扣配置）主键
     * @return 门店会员另设折扣（存储各门店的独立会员折扣配置）
     */
    @Override
    public StoreMemberCustomDiscount selectStoreMemberCustomDiscountById(Long id)
    {
        return storeMemberCustomDiscountMapper.selectStoreMemberCustomDiscountById(id);
    }

    /**
     * 查询门店会员另设折扣列表
     *
     * @param storeName 门店名称
     * @return 门店会员另设折扣（存储各门店的独立会员折扣配置）
     */
    @Override
    public List<StoreMemberCustomDiscount> selectStoreMemberCustomDiscountListByName(String storeName)
    {
        return storeMemberCustomDiscountMapper.selectStoreMemberCustomDiscountListByName(storeName);
    }

    /**
     * 新增门店会员另设折扣列表
     *
     * @param storeMemberCustomDiscount 门店会员另设折扣（存储各门店的独立会员折扣配置）
     * @return 结果
     */
    @Override
    public int insertStoreMemberCustomDiscount(StoreMemberCustomDiscount storeMemberCustomDiscount)
    {
        return storeMemberCustomDiscountMapper.insertStoreMemberCustomDiscount(storeMemberCustomDiscount);
    }

    /**
     * 修改门店会员另设折扣列表
     *
     * @param storeMemberCustomDiscount 门店会员另设折扣（存储各门店的独立会员折扣配置）
     * @return 结果
     */
    @Override
    public int updateStoreMemberCustomDiscount(StoreMemberCustomDiscount storeMemberCustomDiscount)
    {
        return storeMemberCustomDiscountMapper.updateStoreMemberCustomDiscount(storeMemberCustomDiscount);
    }

    /**
     * 批量删除门店会员另设折扣列表
     *
     * @param ids 需要删除的门店会员另设折扣（存储各门店的独立会员折扣配置）主键
     * @return 结果
     */
    @Override
    public int deleteStoreMemberCustomDiscountByIds(Long[] ids)
    {
        return storeMemberCustomDiscountMapper.deleteStoreMemberCustomDiscountByIds(ids);
    }

    /**
     * 删除门店会员另设折扣信息列表
     *
     * @param id 门店会员另设折扣（存储各门店的独立会员折扣配置）主键
     * @return 结果
     */
    @Override
    public int deleteStoreMemberCustomDiscountById(Long id)
    {
        return storeMemberCustomDiscountMapper.deleteStoreMemberCustomDiscountById(id);
    }
}
